package br.com.jbssistemas.dtos;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

/**
 *
 * @author Carol Duarte
 */
@Entity
@Table(name = "setores")
public class Setores implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 10, max = 60, message = "Minimo {min} e Maximo {max} caracteres")
    private String descricao;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 5, max = 40, message = "Minimo {min} e Maximo {max} caracteres")
    private String ordenador;

    public Setores() {

    }

    public Setores(int id, String descricao, String ordenador) {
        this.id = id;
        this.descricao = descricao;
        this.ordenador = ordenador;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getOrdenador() {
        return ordenador;
    }

    public void setOrdenador(String ordenador) {
        this.ordenador = ordenador;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 89 * hash + this.id;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Setores other = (Setores) obj;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return getDescricao();
    }
}
